package com.xhwl.centiotdata.handler.weigh;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author pengjunming
 * @description
 * @date 2022/10/8 10:59
 */
public class WeighIntegrationFactory {

    /**
     * key-供应商id value-集成类
     */
    private static Map<Integer, WeighIntegrationHandler> handlerMap = new HashMap<>();

    public static WeighIntegrationHandler getInvokeStrategy(Integer id) {
        return handlerMap.get(id);
    }

    public static void register(Integer id, WeighIntegrationHandler handler) {
        if (StringUtils.isEmpty(id)) {
            return;
        }
        handlerMap.put(id, handler);
    }
}
